<template>
  <div class="main main_bg">
    <gltitle :titleSize="titleSize" :is_mt="is_mt" ></gltitle>
    <div class="h100"></div>
    <div class="">
      <ul class="item">
        <li>
          <div class="name">{{ $t('new.doc2') }}</div>
          <div class="val">
            <input type="text" v-model="accountBank" :placeholder="$t('new.doc3')" />
          </div>
        </li>
        <li>
          <div class="name">{{ $t('new.doc4') }}</div>
          <div class="val">
            <input type="text" v-model="accountNumber" :placeholder="$t('new.doc5')" />
          </div>
        </li>
        <li>
          <div class="name">{{ $t('new.doc6') }}</div>
          <div class="val">
            <input type="text" v-model="accountName" :placeholder="$t('new.doc7')" />
          </div>
        </li>
        <li>
          <div class="name">{{ $t('new.doc8') }}</div>
          <div class="val">
            <input type="text" v-model="phoneNumber" :placeholder="$t('new.doc9')" />
          </div>
        </li>
        <li>
          <div class="name">IFSC</div>
          <div class="val">
            <input type="text" v-model="ifsc" :placeholder="$t('new.doc10')" />
          </div>
        </li>
      </ul>
      <div class="button">
        <button @click="getAdd">{{ $t('word.ok') }}</button>
      </div>
    </div>

  </div>
</template>
<script>


  export default {
    data(){
      return {
        titleSize:this.$t('new.doc1'),
        is_mt:true,
        accountBank:'',
        accountNumber:'',
        accountName:'',
        phoneNumber:'',
        ifsc:''
      }
    },


    mounted() {

    },
    methods: {
      getAdd(){
        if(!this.accountBank){
          this.$toast(this.$t('new.doc3'))
          return;
        }
        if(!this.accountNumber){
          this.$toast(this.$t('new.doc5'))
          return;
        }
        if(!this.accountName){
          this.$toast(this.$t('new.doc7'))
          return;
        }
        if(!this.phoneNumber){
          this.$toast(this.$t('new.doc9'))
          return
        }
        this.$post(this.URL.user.addBank,{
          accountBank:this.accountBank,
          accountNumber:this.accountNumber,
          accountName:this.accountName,
          phoneNumber:this.phoneNumber,
          ifsc:this.ifsc
        }).then( res =>{
            this.$toast(res.message)
          if(res.code == 0){
            this.$router.go(-1)
          }
        })
      }

    },


  }

</script>


<style lang="less" scoped>
  #app {
    .h100 {
      margin: 0;
    }
    .button {
      padding: 0 .26rem;
      margin-top: .32rem;
      button {
        border:0;
        width: 100%;
        height: .8rem;
        background: #172941;
        color: #fff;
        font-size: .32rem;
      }
    }
    .item {
      padding: 0 .24rem;
      li {
        background: #172941;
        padding:.26rem;
        margin-top: .2rem;
        border-radius: .2rem;
      }
      .val {
        input {
          height: .6rem;background: none;border:0;
          width: 100%;
        }
      }
    }
  }
</style>
